#!/bin/bash

set -e

####
## Functions
####

function initial_conf() {
    # This function runs the initial configuration the module needs once it is installed

    # Add ebox to proxy to read squid logs
    adduser --quiet ebox proxy || true

    # Directory for extra e2g domain lists
    E2G_EXTRALISTS=/etc/e2guardian/extralists
    test -d $E2G_EXTRALISTS || mkdir -p -m 0750 $E2G_EXTRALISTS
}


function mod_disabled() {
    # This function stops and disables the services that uses the module
    systemctl disable --now squid e2guardian
}


####
## Calls
####

initial_conf
mod_disabled

exit 0
